/*
 * bots.h
 *
 *  Created on: Nov 16, 2013
 *      Author: killerg
 */

#ifndef BOTS_H_
#define BOTS_H_

#include "bot.h"

#include "share/net_buffer.h"

class cfg_file_t;
class my_clock_t;
struct event_base;
struct bot_t;


struct bots_t {
    cfg_file_t* cfg;
    my_clock_t* clock;
    event_base* base;
    bot_t* bots;
    code_cb_t code_cb;

    int count[ESSTAGENUM];

    int botnum;
    int startid;
    int totalnum;
    std::queue<account_t*> accounts;


    int max_conning;
    int remain_conning;
    int last_conning;

    bool init(int botnum, int startid, const char* prefix, int totalnum);
    void destroy();
    void loop();

    double timer;

    std::string get_str();
};

extern bots_t g_bots;

#endif /* BOTS_H_ */
